'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _system = require('./static/utils/system.js');

var _system2 = _interopRequireDefault(_system);

function _interopRequireDefault(obj) {
  return obj && obj.__esModule ? obj : {
    default: obj
  };
}

exports.default = App({
  globalData: {
    host: 'https://api.bjlya.com.cn/xcx/app.php?',
    WxHost: 'https://api.bjlya.com.cn/xcx/wxpay/pay.php?'
  },
  onLaunch: function onLaunch() {
    _system2.default.attachInfo();
  },
  onShow: function onShow() {
    var phone = wx.getStorageSync('phone')
    if (!phone) {
      var _this = this
      var host = "https://api.bjlya.com.cn/xcx/app.php?";
      var data = {
        mod: "do",
        act: "tips",
        ssid: wx.getStorageSync('openid') || ''
      };
      wx.request({
        url: host,
        data: data,
        method: "GET",
        header: {
          "content-type": "application/json"
        },
        success: function success(result) {
          // console.log(result)
          var info = result.data.info
          wx.setStorageSync('baseinfo', info.baseinfo)
          wx.setStorageSync('phone', info.phone)
          wx.setStorageSync('phoneinfo', info.phoneinfo)
        }
      })
    }
  },
  onHide: function onHide() {}
});